<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html lang="zh-CN">
<head>
	<meta charset="UTF-8">
	<title>凯盛项目管理系统</title>
	<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<style>
    body{
        width: 960px;
        margin-left: auto;
        margin-right: auto;
    }
  </style>
</head>
<body class="body">
	<%@ include file="include/top.jsp" %>
	<div class="container">
	  <div class="row">
		<div class="span3">
			<%@ include file="include/left.jsp" %>
		</div>
		<div class="span9">
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:5px">
				<li class="active">
					<a href="goal.jspx"><i class="icon-th"></i>${sessionScope.curr_goal.title }</a>
				</li>
				<li style="float:right">
					<i class="icon-edit"></i><a href="editgoal.jspx?id=${sessionScope.curr_goal.id }" class="link-black">编辑</a>
				</li>
			</ul>
			<div class="wall">
				<p style="margin:10px">&nbsp;&nbsp;&nbsp;&nbsp; ${sessionScope.curr_goal.description }</p>
				<!-- 根据当前目标的state值来判断进度条的长度和颜色 -->
				<c:choose>
					<c:when test="${sessionScope.curr_goal.state == 0 }">
						<div class="progress progress-danger">
							<div class="bar" style="width:100%;">当前目标总进度为0</div>
						</div>
					</c:when>
					<c:when test="${sessionScope.curr_goal.state >0 && sessionScope.curr_goal.state < 60 }">
						<div class="progress progress-warning progress-striped active">
							<div class="bar" style="width: ${sessionScope.curr_goal.state}%;">当前目标总进度完成${sessionScope.curr_goal.state }%</div>
						</div>
					</c:when>
					<c:when test="${sessionScope.curr_goal.state >= 60 && sessionScope.curr_goal.state < 100 }">
						<div class="progress progress-striped active">
							<div class="bar" style="width: ${sessionScope.curr_goal.state}%;">当前目标总进度完成${sessionScope.curr_goal.state }%</div>
						</div>
					</c:when>
					<c:when test="${requestScope.curr_goal.state == 100 }">
						<div class="progress progress-success">
							<div class="bar" style="width: 100%;">当前目标全部完成</div>
						</div>
					</c:when>
				</c:choose>

				<div class="page-header">
					<a href="newTask.jspx" class="btn btn-success"><i class="icon-plus icon-white"></i>添加新任务</a>
				</div>
				<dl>
					<c:forEach items="${sessionScope.task_list }" var="task" varStatus="vs">
						<dt><i class="icon-bookmark"></i><a href="#">${task.name }</a>&nbsp;&nbsp;&nbsp;[ ${requestScope.userList[vs.count-1].username } ]</dt>
	        			<dd>${task.description }</dd>
	        		<!-- 根据任务的state值来判断进度条的长度和颜色 -->
	        			<c:if test="${task.state == 0 }">
							<div class="progress progress-danger">
								  <div class="bar" style="width:100%">还没开始</div>
								</div>
						</c:if>
						<c:if test="${task.state > 0 && task.state < 60 }">
							<div class="progress progress-warning progress-striped active">
								  <div class="bar" style="width:${task.state }%">已完成${task.state }%</div>
								</div>
						</c:if>
						<c:if test="${task.state >= 60 && task.state < 100 }">
							<div class="progress progress-striped active">
								  <div class="bar" style="width:${task.state }%">已完成${task.state }%</div>
								</div>
						</c:if>
						<c:if test="${task.state == 100 }">
							<div class="progress progress-success">
								  <div class="bar" style="width:100%">全部完成</div>
								</div>
						</c:if>
					</c:forEach>
        		</dl>
			</div>
		</div>
	  </div>
	</div>
	<%@ include file="include/footer.jsp" %>
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){

		});
	</script>
</body>
</html>